/**
 * Created with  SublimeText
 * @Author:      Lyle
 * @DateTime:    2017-01-17 23:03:23
 * @Description: 
 */
import Config from '../../config'
import lang from '../../i18n/en'

export function init() {
    return (dispatch, getState) => {
        dispatch(getAdminListUser());
    }
}

function receiveList(data) {
    console.log('receiveList', data);
    return {
        type: 'SET_LIST',
        data: { arr: data.data.info}
    }
}

function getAdminListUser() {
    return {
        API: {
            url: Config.API + '?service=AdminUser.listUser',
            callback: function(dispatch, jsonData) {
                console.log(jsonData);
                dispatch(receiveList(jsonData));
            }
        }
    }
}
